package com.example.tms.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.tms.entity.EmployeePerformance;

/**
 * 员工绩效Mapper
 * 提供员工绩效记录的数据库操作
 */
@Mapper
public interface EmployeePerformanceMapper extends BaseMapper<EmployeePerformance> {

    /**
     * 根据员工ID查询绩效记录
     * @param employeePerformance 包含员工ID的绩效对象
     * @return 该员工的绩效记录列表
     */
    @Select("SELECT * FROM employee_performance WHERE emp_id = #{empId} AND is_deleted = 0")
    List<EmployeePerformance> selectByEmpId(EmployeePerformance employeePerformance);
    
    /**
     * 根据考核ID查询绩效记录
     * @param perId 考核ID
     * @return 该考核的绩效记录列表
     */
    @Select("SELECT * FROM employee_performance WHERE per_id = #{perId} AND is_deleted = 0")
    List<EmployeePerformance> selectByPerId(Integer perId);
}
